home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 42
/
Amiga Format AFCD42 (Issue 126, Aug 1999).iso
/
-coverdisks-
/
126a
/
football
/
user
/
viewscheduleandresults.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1999-05-22
|
3KB
|
120 lines
/* ***********************************************************************
VIEW SCHEDULE PROGRAM FOR FOOTBALL REXX SUITE
-----------------------------------------------
Copyright Mark Naughton 1997
Version Date History
--------------------------------------------------------------------------
1.0 150997 First release.
151297 Tidied display.
180499 Amended display, in line with Results.
250499 And again.
**************************************************************************
Procedure
---------
1. Check files exist.
2. Open '.df' file and get the schedule definition file. Set marker.
3. If no file specified, then exit, giving an error.
2. Open file and print all lines without '*' with the exception of
the league name, weeks and dates which are underlined.
3. Close file and exit.
************************************************************************** */
ARG league_file
version = 1
league_file = "Data/" || league_file
input_file = '.sf'
input2_file = '.df'
autosched = '*AUTOSCHD='
separator = '*'
if exists(league_file || input_file) = 0 then exit
if exists(league_file || input2_file) = 0 then exit
autos = 0
if open(datafile,league_file || input2_file,'r') then do
do while ~eof(datafile)
line = readln(datafile)
if pos(autosched,line) > 0 then do
autofile = delstr(line,1,10)
autos = 1
end
end
close(datafile)
end
else do
say
say "ERROR : (ViewScheduleAndResults)"
say
say "Cannot open '"league_file||input2_file"' for reading."
exit
end
if autos = 0 then do
say
say "ERROR : (ViewScheduleAndResults)"
say
say "This program will only show schedule files that have"
say "created from a schedule definition file such as "
say "'Teams6.schd'. Program aborted."
say
exit
end
if open(datafile,league_file || input_file,'r') then do
say
say center("Display Schedule And Results",78)
say "-------------------------------------------------------------------------------"
say
say "Created from '"autofile"' schedule defintion file."
say
do while ~eof(datafile)
line = readln(datafile)
if pos(separator,line) = 0 then do
t1 = right(strip(substr(line,1,30)),30,' ')
say t1||substr(line,31)
end
else do
if words(line) > 1 then do
if pos("*Week",line) > 0 then do
chas = subword(line,2)
do mm=1 to length(chas)
if substr(chas,mm,1) = "0" then
chas = overlay(" ",chas,mm,1)
else
leave
end
chas = "Week "strip(chas)
end
else
chas = subword(line,2)
say chas
uline = ''
do i=1 to length(chas)
uline = insert('-',uline,i,1)
end
say strip(uline)
end
else
if words(line) = 1 then
say
end
end
say "-------------------------------------------------------------------------------"
close(datafile)
end
else do
say
say "ERROR : (ViewScheduleAndResults)"
say
say "Cannot open '"league_file||input_file"' for reading."
end
exit